package geometrie;

public class Farbe {
	private int r, g, b;

	Farbe() {
		this(0,0,0);
	}

	Farbe(int r, int g, int b) {
		if (r < 0 | r > 255)
			this.setR(0);
		else
			this.setR(r);
		
		if (g < 0 | g > 255)
			this.setG(0);
		else
			this.setG(g);
		
		if (b < 0 | b > 255)
			this.setB(0);
		else
			this.setB(b);
	}

	public void setR(int r) {
		this.r = r;
	}

	public int getR() {
		return r;
	}

	public void setG(int g) {
		this.g = g;
	}

	public int getG() {
		return g;
	}

	public void setB(int b) {
		this.b = b;
	}

	public int getB() {
		return b;
	}
	void showFarbe(){
		System.out.println("RGB = "+this.getR()+","+this.getG()+","+this.getB());
	}
	
	
}
